
<%@ page contentType="text/html; charset=UTF-8"  %>
<%@ include file="/classes/DBHelper.class.jsp" %>
<%@ include file="/classes/CommonHelper.class.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	
	String mid = getParameter(request,"mid");
	String chid = getParameter(request,"chid");
	String un = getParameter(request,"un");
	//判断是否存在
	String sqlExt = "select * from NRBZ_BH where mid = ? and chid = ?";
	if(null==getObject(sqlExt,new Object[]{mid,chid})){
		String sql = "insert into NRBZ_BH (MID,CHID,UN) values(?,?,?)";
		int k = executeUpdate(sql,new Object[]{mid,chid,un});
	}else{
		String sql = "update NRBZ_BH  set UN = ? where MID = ? and CHID = ? ";
		int k = executeUpdate(sql,new Object[]{un,mid,chid});
	}
%>


